home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16.lha / Python-1.6 / Lib / Python1.6 / distutils / command / install_headers.py < prev    next >
Encoding:
Python Source  |  2000-07-08  |  1.2 KB  |  48 lines

  1. """distutils.command.install_headers
  2.  
  3. Implements the Distutils 'install_headers' command, to install C/C++ header
  4. files to the Python include directory."""
  5.  
  6. # created 2000/05/26, Greg Ward
  7.  
  8. __revision__ = "$Id: install_headers.py,v 1.4 2000/07/07 20:41:21 jhylton Exp $"
  9.  
  10. import os
  11. from distutils.core import Command
  12.  
  13.  
  14. class install_headers (Command):
  15.  
  16.     description = "install C/C++ header files"
  17.  
  18.     user_options = [('install-dir=', 'd',
  19.                      "directory to install header files to"),
  20.                    ]
  21.  
  22.  
  23.     def initialize_options (self):
  24.         self.install_dir = None
  25.         self.outfiles = []
  26.  
  27.     def finalize_options (self):
  28.         self.set_undefined_options('install',
  29.                                    ('install_headers', 'install_dir'))
  30.  
  31.     def run (self):
  32.         headers = self.distribution.headers
  33.         if not headers:
  34.             return
  35.  
  36.         self.mkpath(self.install_dir)
  37.         for header in headers:
  38.             out = self.copy_file(header, self.install_dir)
  39.             self.outfiles.append(out)
  40.  
  41.     def get_inputs (self):
  42.         return self.distribution.headers or []
  43.  
  44.     def get_outputs (self):
  45.         return self.outfiles
  46.  
  47. # class install_headers
  48.